package reflect;

public class ArgsDemo {
    public static void main(String[] args) {
        test("a");
        test(new String[]{"a"});
        test("a","b");
        test(new String[]{"a","b"});
    }

    //变长参数必须是一个方法中最后一个参数
    public static void test(String... arg){
        //arg实际是个数组
        System.out.println(arg.length);
    }
}
